import { NestFactory } from '@nestjs/core'
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
import { AppModule } from './app.module'

async function bootstrap() {
	const app = await NestFactory.create(AppModule)
	app.setGlobalPrefix('kmhome/api')
	app.enableCors()

	const options = new DocumentBuilder()
    //接口文档标题
    .setTitle('KMHome Api')
    //接口文档描述
    .setDescription('The user API description')
    .setVersion('1.0')
    .build()
	const document = SwaggerModule.createDocument(app, options)
	SwaggerModule.setup('api-docs', app, document)

	await app.listen(3000)
}

bootstrap()
